{include file="index/header" /}


 

<!--是否为手机访问-->

{if condition="request()->isMobile()==false"}

<!--Ueditor代码高亮样式 -->
<script type="text/javascript" src="__STATIC__/ueditor/third-party/SyntaxHighlighter/shCore.js"></script>
<link rel="stylesheet" type="text/css" href="__STATIC__/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css">
<script type="text/javascript">
    SyntaxHighlighter.all();
</script>
<!--Ueditor代码高亮样式 -->

{/if}
 <style type="text/css">
    video::-internal-media-controls-download-button {
        display:none;
    }
    video::-webkit-media-controls-enclosure {
        overflow:hidden;
    }
    video::-webkit-media-controls-panel {
        width: calc(100% + 30px);
    }
</style>


<div class="row">
    <div class="col-xs-12 col-sm-12 col-md-12" style=" display: {$list.address?'none':''}">

        <!--价格等于0元或者已经购买的播放-->
        {if condition="($order >=1) OR ($list.price == 0)"}



        {if condition="$t>3000"}
        <div class="alert alert-info alert-dismissible" role="alert" style="display: none;">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            本节课您上次学习到第 <strong>{$t|date="i:s",###}</strong> 分 ，已 继续播放^_^
        </div>
        {/if}

        {if condition="$list.address==''"}


        <video    controls="controls"  poster="__STATIC__/thinkphp5.jpg"  id="myVideo"    style="width:100%; height:100%; object-fit: fill" >

            
             
            <source src="http://dc.gaoxueya.com/video/thinkphp5%20({$list.sort}).mp4#t={$t}" type="video/mp4">
             
            Your brows
        </video>


 

        <!--管理调制视频进度功能-->

        {if condition="$Think.cookie.admin>=1" }{/if}

        <div style="display: none">
            <p id="t"></p> <h4 id="l"></h4>
            <p>记录进度：<span id="txtHint"></span><span id="txtHintOver"></span></p>
        </div>



        <button id="playPause" type="button" onclick="playPause()"  class="btn btn-default"  >暂停</button>

        <!--控制播放速度的下拉菜单-->
        <div class="btn-group dropup">
            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                播放速度 <span class="caret"></span>
            </button>
            <ul class="dropdown-menu">
                <li><a onclick="setPlaySpeed(2)">2倍最快</a></li>
                <li><a onclick="setPlaySpeed(1.75)">1.75倍</a></li>
                <li><a onclick="setPlaySpeed(1.5)">1.5倍</a></li>
                <li><a onclick="setPlaySpeed(1.25)">1.25倍</a></li>
                <li><a onclick="setPlaySpeed(1)">1倍</a></li>
                <li><a onclick="setPlaySpeed(0.75)">0.75倍</a></li>
                <li><a onclick="setPlaySpeed(0.5)">0.5倍最慢</a></li>
                <li role="separator" class="divider"></li>
                <li><a onclick="setPlaySpeed(1)">默认速度</a></li>
                <li><a onclick="getPlaySpeed()">当前速度</a></li>
            </ul>
        </div>

        <button type="button" class="btn btn-default  " data-toggle="modal" data-target="#myModal">
            课后作业
        </button>
        {if condition="$list.price>0"}
        <button type="button" class="btn btn-default  "  onclick="ajaxModelPay('{$list.price}','{$list.id}','{$list.title}{$Request.ip}','{$list.id}{$Think.cookie.phone}{:time()}')" >
            {$list.price}元/年  扫码支付
        </button>
        {/if}
        <a class="btn btn-default" href="https://jq.qq.com/?_wv=1027&k=5OjhBDy" role="button">下载源码</a>
        <a  href="__ROOT__/index/member/tip" id="btn" class="btn btn-danger" target="_blank"  >打赏</a> 

        <button onclick="showFull()" type="button" style="display: none">全屏</button>




        {/if}

        <!-- 购买后可见： -->
        {if condition="$list.product"}
        <div class="panel panel-default" style="margin: 15px">
             <div class="panel-body">
                    <p> {:nl2br($list.product)} </p>
          </div>
        </div> 
        {/if}

        {else /}

        {if condition="$list.address"}
 
<div style="width: 100%;height: 50vw;">
 <div style=" width: 300px;
    height: 140px;
    padding: 20px;
    position: absolute;
    top: 30%;
    left: 50%;
    margin-left:">
     
      

      <h3 style="    font-size: 24px;    text-indent: .5em;    color: #ccc;padding-bottom: 30px;">请付费后学习完整内容</h3>

 <button type="button" class="btn btn-danger "  onclick="ajaxModelPay('{$list.price}','{$list.id}','{$list.title}{$Request.ip}','{$list.id}-{:time()}')" style="width: 170px;
    height: 48px;margin-left: 20px" >
                {$list.price}元/年  扫码支付
            </button>
     <button style="display: none" type="button" class="btn btn-danger" onclick="ajaxModelPay('9.9','105','9.9元 ThinkPHP5简易商城VIP会员30天 {$list.id} ','{$list.id}{$Think.cookie.phone}{:time()}')" style="width: 170px;
    height: 48px;margin-left: 20px" >
                购买
            </button>


 </div>
</div>
        {/if}

        <a style="display: none;" href="__ROOT__/index/member/invite" id="btn" class="btn btn-warning" target="_blank"  >邀请一个同学注册即可免费观看本节</a>





            <button type="button" class="btn btn-default  "  onclick="ajaxModelPay('{$list.price}','{$list.id}','{$list.title}{$Request.ip}','{$list.id}-{:time()}')" >
                {$list.price}元/年  扫码支付
            </button>
            <a style="display: none;" href="__ROOT__/alipay/alipayapi.php?WIDtotal_fee=168&WIDsubject=【vip】thinkphp5 入门培训vip会员6个月&WIDout_trade_no={$list.id}{$Think.cookie.phone}{$date}&WIDbody=105&WIDshow_url=" id="btn" class="btn btn-warning" target="_blank"  >开通VIP会员免费看</a>
            <a  href="__ROOT__/index/member/vip" id="btn" class="btn btn-warning" target="_blank"  >开通VIP会员免费看</a>


            <a class="btn btn-default" href="https://jq.qq.com/?_wv=1027&k=5QmBs7e" role="button">下载源码</a>
            <a class="btn btn-default" href="__ROOT__/index/member/invite/id/{$list.id}" role="button">金币兑换</a>

            <a  href="__ROOT__/index/member/tip" id="btn" class="btn btn-danger" target="_blank"  >打赏</a>


        {/if}


        {if condition="$list.red_packet_count>0"}
        <div class="alert alert-danger" role="alert" style="display:none;">
            <span class="glyphicon glyphicon-flag" aria-hidden="true"></span>
            <span class="sr-only">Error:</span>

            {if condition="$list.red_packet_lesson"}
             已生成红包！ 红包(id{$list.red_packet_lesson_id})金额:{$list.red_packet_lesson}元 请截此图到qq群189250799领取
            {else /}
            您有一个现金红包！



            <!--<a  href="__ROOT__/index/index/view/red_packet_get/1/id/{$list.id}" id="btn" class="btn btn-danger" target="_self"  ><span   class="glyphicon glyphicon-gift" aria-hidden="true"></span> 点此领取红包</a>-->
            <a   onclick="red_packet({$list.id})" id="btn" class="btn btn-danger" target="_self"  ><span   class="glyphicon glyphicon-gift" aria-hidden="true"></span> 点此领取红包</a>



            <span id="red_packet"></span>
            {/if}
        </div>
        {/if}


    </div> <!--这个是左侧播放器的结束部分-->
<div class="col-xs-12 col-sm-12 col-md-12"  >
 

 <div class="panel panel-default">
  <div class="panel-body " style="display: none" >
      <div class="media" >
                            <div class="media-left" >
                                <a href="#">
                                    <img class="media-object img-circle"    src="__STATIC__/images/user/user ({:rand(1,25)}).jpg" data-holder-rendered="true" style="width: 30px; height: 30px;">
                                </a>
                            </div>
                            <div class="media-body">
                        <a href="#">18210787405</a><br /><small> </small> 
                            </div>
                            <div class="media-right" >
                                 <a class="btn btn-default" href="#" role="button">关注</a>
                            </div>
                        </div>
  </div>
  <div class="panel-footer"> 

            <h4>{$list.title}</h4>
         <h5>{$list.content}</h5>

</div>
</div>



 
   <div class="panel panel-default" style="display: none">
    <div class="panel-heading">本课介绍</div>
    <div class="panel-body">


        <p>{$list.content}</p>
        <p>价格：{$list.price}    日期：{$list.create_time} 标签：
            {foreach name="list.label" item="vo" } 发布于：{$list.create_time}

            <a class="btn btn-default btn-xs" href="__ROOT__/index/index/like?search={$vo}" role="button">{$vo}</a>


            {/foreach}
             IP:{$Request.ip} 学习 会员：{$list.play_count}人</p>
        





    </div>

</div>


        <div class="panel panel-default" > 
            <div class="panel-heading">

                <span  class="glyphicon glyphicon-edit" aria-hidden="true"></span>      {$talk[0]['id']?'精彩评论':'发布评论'}
            </div>
            <div class="panel-body" >

                    
 
                <span id="bbs" style="display: none">666999</span>

                <div class="bss_content"  id="bss_content"   style="margin-bottom: 10px;   word-wrap:break-word;">

                    <span id="bbs_index">

                    {volist name='talk' id='user'}

                    <div   class=" col-xs-12 col-sm-12 col-md-12 " style="padding: 0px;    border-bottom: 1px solid #eee;    margin-bottom: 10px; ">


                        <div class="media" >
                            <div class="media-left" >
                                <a href="#">
                                    <img class="media-object img-circle"    src="__STATIC__/images/user/user ({:rand(1,25)}).jpg" data-holder-rendered="true" style="width: 34px; height: 34px;">
                                </a>
                            </div>
                            <div class="media-body">

<!-- 点赞左右结构 -->
<div class="row">
  <div class="col-xs-6 col-md-8">
        <small><a href="#">{$user.id|substr=0,3}****{$user.id|substr=7,4}</a></small>
  </div>
  <div class="col-xs-3  col-md-1 pull-right"> 
        <span onclick='public_ajax("{$Think.server.script_name}/index/index/view/data_id/{$user.id}",0)' style="position: relative;">  
                <span id="like_{$user.id}"  style="color: #555;">{$user.likes?$user.likes:"赞"}</span> 
                                    <span id="like_icon_{$user.id}" style="color: {$user.on?'#0084ff':'#8590a6'}; fill: currentColor;"> 
            <svg viewBox="0 0 20 18" xmlns="http://www.w3.org/2000/svg" class="likeicon" width="13" height="16" aria-hidden="true" style="height: 16px; width: 13px;"><title></title><g><path d="M.718 7.024c-.718 0-.718.63-.718.63l.996 9.693c0 .703.718.65.718.65h1.45c.916 0 .847-.65.847-.65V7.793c-.09-.88-.853-.79-.846-.79l-2.446.02zm11.727-.05S13.2 5.396 13.6 2.89C13.765.03 11.55-.6 10.565.53c-1.014 1.232 0 2.056-4.45 5.83C5.336 6.965 5 8.01 5 8.997v6.998c-.016 1.104.49 2 1.99 2h7.586c2.097 0 2.86-1.416 2.86-1.416s2.178-5.402 2.346-5.91c1.047-3.516-1.95-3.704-1.95-3.704l-5.387.007z"></path></g></svg>
            </span>  
                                  
                                  <span id="like_a_{$user.id}" style="position:absolute;left:0px;top:0px;z-index:-20;color: red ;animation:mylike 2s;display:none ">+1</span>

                               </span>
  </div>
</div>

                                <small> 

                                  {if condition="$user.age >=100"}
                                <div class="form-group input-group field-feed-content required" style="background-color:  #f4f4f4;padding: 10px;color: #555555">

                                     @{$user.r_phone|substr=0,3}****{$user.r_phone|substr=7,4}:{$user.r_title}
                 
                                </div>

                               {/if}
                                    {$user.title}
                                        

                                </small>
                                <h5> <small> {$user.create_time}  

                                           <a href = "javascript:void(0);"  onclick="document.getElementById('reply_{$user.id}').style.display = '' " >回复</a>

                                                                     </small></h5>
                               

                                               <div id="reply_{$user.id}" class="form-group input-group field-feed-content required" style="display: none">

                    <textarea id="titleChat_{$user.id}" name="title"  class="form-control"  placeholder="写回复" aria-required="true"></textarea>
                    <span class="input-group-btn"><button type="submit" class="btn btn-success" onclick="bbs(document.getElementById('titleChat_{$user.id}').value,{$list.id},{$user.id})" style="height: 54px;width: 54px;">发布</button></span>

 
                </div>

                            </div>
                        </div>



                    </div>




                    {/volist}

  


                        </span>
 
                </div>

{if condition="$Request.param.reply >=1"}
                <div class="form-group input-group field-feed-content required" style="background-color:  #e3e3e3;padding: 10px">

                     回复 @{$Request.param.r_phone}:{$Request.param.r_title}
 
                </div>

{/if}

 
                <div class="form-group input-group field-feed-content required">

                    <textarea id="titleChat" name="title"  class="form-control"  placeholder="{$Request.param.data_id?'写回复内容':'写评论'}..." aria-required="true"></textarea>
                    <span class="input-group-btn"><button type="submit" class="btn btn-success" onclick="bbs(document.getElementById('titleChat').value,{$list.id},{$Request.param.data_id})" style="height: 54px;width: 54px;">发布</button></span>

 
                </div>

                 
                   



                         <script type="text/javascript">


//回车事件绑定
$('myVideo').bind('keyup', function(event) {
    if (event.keyCode == "32") {
        //回车执行查询

        $('#pauseVideo').click();

    }

});

//回车事件绑定
$('#titleChat').bind('keyup', function(event) {
    if (event.keyCode == "13") {
        //回车执行查询
        $('#sendChat').click();

    }

});


</script>


                        <!--控制有输入聊天内容时打开发送按钮-->

                        <script type="text/javascript">
var obj=document.getElementById("titleChat");
obj.onkeyup=function(){
    if(obj.value.length==0){
        $("#sendChat").attr("disabled", true);
    }else {
        //code 向后台提交
        $("#sendChat").attr("disabled", false);
    }
}
</script>
                    

                



            </div>
        </div>

    </div> <!--这个是右侧聊天的结束部分-->
</div>
<!--以上是提示购买的结束-->
<div class="page-header" style="display: none">
    <h3>{$list.title} <small>{$list.page_view} 次</small> </h3>
    <div class="btn-toolbar" role="toolbar">

    </div>
</div>

<div class="row">
    {if condition="$up neq ''"}
    <div class="col-xs-12 col-sm-6 col-md-4">        <a class="btn btn-default btn-block" style="margin-bottom: 10px; text-overflow:ellipsis; white-space:nowrap; overflow:hidden;" href="__ROOT__/index/index/view/id/{$up.id}" role="button">上一课：{$up.title}</a>
    </div>
    {else}
    <div class="col-xs-12 col-sm-6 col-md-4">        <a class="btn btn-default btn-block" style="margin-bottom: 10px; text-overflow:ellipsis; white-space:nowrap; overflow:hidden;" href="#" role="button">这是第一课</a>
    </div>
    {/if}
    <div class="col-xs-12 col-sm-6 col-md-4">   </div>
    {if condition="$next neq ''"}
    <div class="col-xs-12 col-sm-6 col-md-4">        <a class="btn btn-default btn-block" style="margin-bottom: 10px; text-overflow:ellipsis; white-space:nowrap; overflow:hidden;" href="__ROOT__/index/index/view/id/{$next.id}" role="button">下一课：{$next.title}</a>
    </div>
    {else}
    <div class="col-xs-12 col-sm-6 col-md-4">        <a class="btn btn-default btn-block" style="margin-bottom: 10px; text-overflow:ellipsis; white-space:nowrap; overflow:hidden;" href="#" role="button">这是最后一课</a>
    </div>
    {/if}
</div>






{if condition="($order <=0) AND ($list.price >= 0.01)"}
{if condition="$list.address"}
<div class="panel panel-default">
    <div class="panel-heading">学习币兑换</div>
    <div class="panel-body">
        <a class="btn btn-default btn-block" href="__ROOT__/index/member/invite/id/{$list.id}" role="button">点击兑换</a>
    </div>
</div>
{/if}{/if}

<div class="panel panel-default" style="display: none">
    <div class="panel-heading">上课笔记/评论  </div>
    <div class="panel-body">


        <form action="{$Think.server.script_name}/index/bbs/add" method="post">
            <div class="form-group" >
                <!-- <label for="exampleInputName2">留言标题title:</label> -->
                <!--<input type="text" class="form-control" id="title" name="title" value="" placeholder="请输入留言标题" maxlength="100">-->
                <textarea class="form-control" rows="3"  id="title_homework" name="title_homework"  value="" placeholder="上课笔记或评论内容"></textarea>

            </div>
            <!--<div class="form-group">-->
            <!--&lt;!&ndash; <label for="exampleInputPassword1">留言内容content:</label> &ndash;&gt;-->
            <!--<textarea class="form-control" rows="3"  id="content" name="content"  value="" placeholder="上课笔记或评论内容"></textarea>-->
            <!--</div>-->

            <input class="form-control" id="add" type="button" onclick="bbs(document.getElementById('title_homework').value,{$list.id})"  style="    margin-bottom:  15px;" name="code" value="提交保存" />

        </form>
        {$Think.cookie.phone? '':'<a href=__ROOT__/index/index/login/>点击登录</a>后课查看上课笔记/评论'}


    </div>

</div>




<div class="panel panel-default">
    <div class="panel-heading">评论 </div>


    <div class="panel-body">

        <table class="table" style="word-break:break-all; word-wrap:break-all;">


            <tbody>
            <span id="chat"></span>



            

            {volist name='bbs' id='user'}
            <tr  ><td class="type-info" style="border-top: 0px;border-bottom: 1px solid #ddd;">

<!-- 点赞头部的排版 -->
<div class="row" style="margin-bottom: 10px">
  <div class="col-xs-2 col-md-1 "  >
    <a href="#">
                                    <img class="media-object img-circle"    src="__STATIC__/images/user/user ({:rand(1,25)}).jpg" data-holder-rendered="true" style="width: 34px; height: 34px;">
                                </a>
  </div>
  <div class="col-xs-6 col-md-9  ">
    <h6><small>{$user.id|substr=0,3}****{$user.id|substr=7,4}</small></h6>
</div>
  <div class="col-xs-3  col-md-1 pull-right"  >
      <!-- 点赞的功能 -->
                        <span onclick='public_ajax("{$Think.server.script_name}/index/index/view/all/1/data_id/{$user.id}",0)' style="position: relative;">

                            <small><span id="like_all_{$user.id}" style="color: #555;">{$user.likes?$user.likes:"赞"}</span> </small> 
                                    <span id="like_icon_all_{$user.id}" style="color: {$user.on?'#0084ff':'#8590a6'}; fill: currentColor;"> 
                            <svg viewBox="0 0 20 18" xmlns="http://www.w3.org/2000/svg" class="likeicon" width="13" height="16" aria-hidden="true" style="height: 16px; width: 13px;"><title></title><g><path d="M.718 7.024c-.718 0-.718.63-.718.63l.996 9.693c0 .703.718.65.718.65h1.45c.916 0 .847-.65.847-.65V7.793c-.09-.88-.853-.79-.846-.79l-2.446.02zm11.727-.05S13.2 5.396 13.6 2.89C13.765.03 11.55-.6 10.565.53c-1.014 1.232 0 2.056-4.45 5.83C5.336 6.965 5 8.01 5 8.997v6.998c-.016 1.104.49 2 1.99 2h7.586c2.097 0 2.86-1.416 2.86-1.416s2.178-5.402 2.346-5.91c1.047-3.516-1.95-3.704-1.95-3.704l-5.387.007z"></path></g></svg>
                        </span> 

                        </span>
                                   <!-- {$user.likes?$user.likes:"赞"} --><span id="like_a_all_{$user.id}" style="position:absolute;left:0px;top:0px;z-index:-20;color: red ;animation:mylike 2s;display:none "></span>
  </div>
</div>

                
                
                        
                        




                <!-- 引用的回帖部分          -->
                {if condition="$user.age >=100"}
                                <div class="form-group input-group field-feed-content required" style="background-color:  #f4f4f4;padding: 10px;color: #555555">

                                     @{$user.r_phone|substr=0,3}****{$user.r_phone|substr=7,4}:{$user.r_title}
                 
                                </div>

                {/if}
                {:nl2br($user.title)}
                <h5> <small> {$user.create_time}    

                                   

                                  <a href = "javascript:void(0);"  onclick="document.getElementById('reply_all_{$user.id}').style.display = '' " >回复</a>

                                                                     </small></h5>
                               

                                               <div id="reply_all_{$user.id}" class="form-group input-group field-feed-content required" style="display: none">

                    <textarea id="titleChat_all_{$user.id}" name="title"  class="form-control"  placeholder="写回复" aria-required="true"></textarea>
                    <span class="input-group-btn"><button type="submit" class="btn btn-success" onclick="bbs(document.getElementById('titleChat_all_{$user.id}').value,{$list.id},{$user.id})" style="height: 54px;width: 54px;">发布</button></span>

 
                </div>





            </td></tr>

            {/volist}
            </tbody>
        </table>
 
    </div>

</div>






<div class="panel panel-default">
    <div class="panel-heading">扫码观看当前课程</div>
    <div class="panel-body text-center">
        <img src="http://bshare.optimix.asia/barCode?site=weixin&url= {$Request.root.true}/{$Request.path}" />
        <!-- 最近几天发现百度这个二维码接口失效了，换了一个接口 -->
        <!-- 假如使用过这个接口印刷的名片等纸质材料，可能影响很大 -->
        <!-- 总结，临时使用还可以，长期使用还需要学习一个独立稳定的方式 -->
        <!-- <img src="http://pan.baidu.com/share/qrcode?w=200&h=200&url= {$Request.root.true}/{$Request.path}" /> -->
        
    </div>
</div>

<div class="panel panel-default">
    <div class="panel-heading">赞助商</div>
    <div class="panel-body text-center">
          
 欢迎加入

    </div>
</div>

<div class="panel panel-default">
    <div class="panel-heading">已完成本课的同学</div>
    <div class="panel-body text-center">
          
 欢迎加入

    </div>
</div>

<div class="panel panel-default">
    <div class="panel-heading">学习本课中的同学</div>
    <div class="panel-body text-center">
          
 欢迎加入

    </div>
</div>



<!-- Button trigger modal -->
<!-- <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
    Launch demo modal
</button> -->

<!-- Modal 作业-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">本节学习完成</h4>
            </div>
            <div class="modal-body"><p class="text-center">
                <span class="glyphicon glyphicon-star" aria-hidden="true" style="font-size: 60px;color: #f0ad4e;" title="本课学习完成一次获得"></span>
                <span class="glyphicon glyphicon-star" aria-hidden="true" style="font-size: 60px;color: #f0ad4e;"  title="评论一次本节课程即可获取"></span>
                <span class="glyphicon glyphicon-star" aria-hidden="true" style="font-size: 60px;color: #f0ad4e;" title="评论2次本节课程即可获取"></span></p>
                <h3 class="text-center">本节的知识点有哪些：</h3>
                <form action="" method="post">
                    <div class="form-group" >
                        <!-- <label for="exampleInputName2">留言标题title:</label> -->
                        <!--<input type="text" class="form-control" id="title" name="title" value="" placeholder="请输入留言标题" maxlength="100">-->
                        <textarea class="form-control" rows="3"  id="titlemodel" name="title"  value="" placeholder="填写问题答案"></textarea>

                    </div>
                    <!--<div class="form-group">-->
                    <!--&lt;!&ndash; <label for="exampleInputPassword1">留言内容content:</label> &ndash;&gt;-->
                    <!--<textarea class="form-control" rows="3"  id="content" name="content"  value="" placeholder="上课笔记或评论内容"></textarea>-->
                    <!--</div>-->
                    <!--<button type="button" class="close" onclick="bbs(document.getElementById('titlemodel').value,{$list.id})" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">提交作业</span></button>-->
                    <h6>本节课有疑问的地方可以直接提交问题</h6>
                    <h6>完成本节作业，增加一颗星和一个金币</h6>
                    <!--<input class="form-control" id="add" type="button" onclick="bbs(document.getElementById('title').value,{$list.id})"  style="    margin-bottom:  15px;" name="code" value="提交保存" />-->
                    <!--<button type="submit" onclick="bbs(document.getElementById('titlemodel').value,{$list.id})" class="btn btn-primary">提交作业ba</button>-->
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" onclick="bbs(document.getElementById('titlemodel').value,{$list.id})"  class="btn btn-primary" data-dismiss="modal">提交作业</button>
            </div>
        </div>
    </div>
</div>



<script>


 


 

    // 更新本页面访问量的ajax
    function page_view(id)
    {

        var xmlhttp;

        // alert(id);

        if (window.XMLHttpRequest)
        {
            // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlhttp=new XMLHttpRequest();
        }
        else
        {
            // IE6, IE5 浏览器执行代码
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
                // document.getElementById("red_packet").innerHTML=xmlhttp.responseText;
                // document.getElementById("red_packet").innerHTML='99';


            }
        }
        xmlhttp.open("GET","/index/index/view/page_view/"+id,true);
        xmlhttp.send();

    }


    var myVideo=document.getElementById("myVideo");

    function playPause()
    {
        if (myVideo.paused)
        {
            myVideo.play();
            document.getElementById("playPause").innerHTML="暂停";
        }


        else
        {
            myVideo.pause();
            document.getElementById("playPause").innerHTML="开始";
        }

    }

    function makeBig()
    {
        myVideo.width=560;
    }

    function makeSmall()
    {
        myVideo.width=320;
    }

    function makeNormal()
    {
        myVideo.width=420;
    }
    //全屏
    function showFull(){
        myVideo.requestFullscreen();
    }
</script>

<script>

    var myVideo=document.getElementById("myVideo");
    // 调用模态框
    function show_modal() {
        $('#myModal').modal('show');
    }
    // 对接h5的video的播放进度接口
    myVideo.onplay = function()
    {
        // $('#myModal').modal(options);
        // document.getElementById("myModal").modal=options;
        // alert("视频已经开始播放");
        // document.getElementById("chat").innerHTML=document.getElementById("chat").innerHTML+xmlhttp.responseText;
        // $('#myModal').modal('show');
        // alert("播放")
        // ;


        myVideo.addEventListener("timeupdate",function(){
            console.log(this.currentTime);
            document.getElementById("t").innerHTML=this.currentTime;
            // var name='{$Request.get.id}';
            // alert({$Request.param.id});
            showHint(this.currentTime,{$Request.param.id},this.duration);
            if (this.currentTime>=2.1&this.currentTime<=2.3){
                bbs_ask("ask_ajax_play_welcome",{$list.id});
            }
            document.getElementById("l").innerHTML=this.duration;

        });
        myVideo.addEventListener("loadedmetadata",function(){
            this.play();
        });
    };

    myVideo.onended = function() {
        // document.getElementById("l").innerHTML="本节学习完成！每节课完成讲获得0.1元奖励金（即将推出^_^）";
        showHintOver(this.duration,{$Request.param.id},this.duration);

    };
</script>
<script>
    // 获取红包的ajax
    function red_packet(id)
    {

        var xmlhttp;


        if (window.XMLHttpRequest)
        {
            // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlhttp=new XMLHttpRequest();
        }
        else
        {
            // IE6, IE5 浏览器执行代码
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
                document.getElementById("red_packet").innerHTML=xmlhttp.responseText;
                // document.getElementById("red_packet").innerHTML='99';


            }
        }
        xmlhttp.open("GET","/index/index/view/red_packet_get/1/id/"+id,true);
        xmlhttp.send();

    }

    // 记录播放进度的ajax
    function showHint(t,id,d)
    {

        var xmlhttp;


        // var phone = str.length;
        //   if(!(/^1[34578]\d{9}$/.test(phone))){
        //       document.getElementById("txtHint").innerHTML="手机号格式有误";
        //       return false;
        //   }
        if (window.XMLHttpRequest)
        {
            // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlhttp=new XMLHttpRequest();
        }
        else
        {
            // IE6, IE5 浏览器执行代码
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
                document.getElementById("txtHint").innerHTML=xmlhttp.responseText;

                // document.getElementById("bbs").innerHTML=xmlhttp.responseText+document.getElementById("bbs").innerHTML;
                // document.getElementById("chat").innerHTML=document.getElementById("chat").innerHTML+xmlhttp.responseText;
                // 实现跳转到div的最下面
                // document.getElementById('chat').scrollTop = document.getElementById('chat').scrollHeight;

            }
        }
        xmlhttp.open("GET","/index/index/videotime/t/"+t+"/id/"+id+"/d/"+d,true);
        xmlhttp.send();

    }
</script>
<script>
    // 记录播放完成ajax
    function showHintOver(t,id,d)
    {

        var xmlhttp;


        // var phone = str.length;
        //   if(!(/^1[34578]\d{9}$/.test(phone))){
        //       document.getElementById("txtHint").innerHTML="手机号格式有误";
        //       return false;
        //   }
        if (window.XMLHttpRequest)
        {
            // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlhttp=new XMLHttpRequest();
        }
        else
        {
            // IE6, IE5 浏览器执行代码
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
                // document.getElementById("txtHintOver").innerHTML=xmlhttp.responseText;
                // document.getElementById("bbs").innerHTML=xmlhttp.responseText+document.getElementById("bbs").innerHTML;
                document.getElementById("chat").innerHTML=document.getElementById("chat").innerHTML+'<h5 class="text-center"><small>'+xmlhttp.responseText+'</small></h5>';
                // 实现跳转到div的最下面
                // document.getElementById('chat').scrollTop = document.getElementById('chat').scrollHeight;
                if (xmlhttp.responseText != "您此次似乎没连续看完整节课程,连续看完才能学的扎实哦^_^"){
                    $('#myModal').modal('show');
                }
            }
        }
        xmlhttp.open("GET","/index/index/videotimeover/t/"+t+"/id/"+id+"/d/"+d,true);
        xmlhttp.send();

    }

    // 设置打开网页后16秒自动发送欢迎词
    // setTimeout(functionfunction(){ bbs_ask("ask_ajax_welcome",{$list.id}); }, 16000);
    // setTimeout(alert('d')}, 1000);

</script>




<script>

    // 评论功能的ajax函数
    function bbs(t,id,data_id)
    {
        t = t.trim();

         



        var xmlhttp;

        if (t.length==0)
        {
            document.getElementById("titleChat").innerHTML="";
            document.getElementById("feed-content").innerHTML="";
            return;

        }


        if (window.XMLHttpRequest)
        {
            // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlhttp=new XMLHttpRequest();
        }
        else
        {
            // IE6, IE5 浏览器执行代码
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {


                // document.getElementById("bbs").innerHTML=xmlhttp.responseText+document.getElementById("bbs").innerHTML;
                document.getElementById("bbs").innerHTML=document.getElementById("bbs").innerHTML+xmlhttp.responseText;
                // document.getElementById("chat").innerHTML=document.getElementById("chat").innerHTML+xmlhttp.responseText;
                // document.getElementById("bbs_index").innerHTML=xmlhttp.responseText+document.getElementById("bbs_index").innerHTML;
                document.getElementById("bbs_index").innerHTML=document.getElementById("bbs_index").innerHTML+xmlhttp.responseText;
                // document.getElementById('chat').scrollTop = document.getElementById('chat').scrollHeight;
                // document.getElementById('bbs_index').scrollTop = document.getElementById('bbs_index').scrollHeight;
                // document.getElementById('bss_content').scrollTop = document.getElementById('bss_content').scrollHeight;

                // 如果是回复评论，回复后取消url的传值，刷新页面
                        if (data_id>=1) 
                    {
                        window.location.href="{$Think.server.script_name}/index/index/view/id/" +id 
                    }


            }
        }
        xmlhttp.open("POST","{$Think.server.script_name}/index/bbs/add/",true);
        // xmlhttp.open("GET","/index/bbs/add/title/"+t+"/shop/"+id,true);
        xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
        // xmlhttp.send("t=Bill&lname=Gates");
        
        xmlhttp.send("title="+t+"&shop="+id+"&age="+data_id);
        // xmlhttp.send();
        bbs_song("ask_song");



        // 发送完成后清空内容
        document.getElementById('titleChat').value ="";
        document.getElementById('title_homework').innerText="";
        // document.getElementById("sendChat").value='';
        // 发送完成后禁止再次点击发送按钮
        // document.getElementById("sendChat").disabled= true;
        // document.getElementById('chat').scrollTop = document.getElementById('chat').scrollHeight;

        // $('#chat').scrollTop( $('#chat')[0].scrollHeight );
        // var content = document.getElementById('chat');
        // content.scrollTop = content.scrollHeight;

    }

    // 评论功能的ajax函数
    function bbsOLd(t,id)
    {
        t = t.trim();
        var xmlhttp;
        if (t.length==0)
        {
            document.getElementById("titleChat").innerHTML="";
            return;

        }


        if (window.XMLHttpRequest)
        {
            // IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlhttp=new XMLHttpRequest();
        }
        else
        {
            // IE6, IE5 浏览器执行代码
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
                document.getElementById("chat").innerHTML=xmlhttp.responseText+document.getElementById("bbs").innerHTML;
                document.getElementById("bbs").innerHTML=document.getElementById("chat").innerHTML+xmlhttp.responseText;
                document.getElementById('bbs').scrollTop = document.getElementById('chat').scrollHeight;

            }
        }
        xmlhttp.open("POST","{$Think.server.script_name}/index/bbs/add/",true);
        // xmlhttp.open("GET","/index/bbs/add/title/"+t+"/shop/"+id,true);
        xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
        // xmlhttp.send("t=Bill&lname=Gates");
        xmlhttp.send("title="+t+"&shop="+id);
        // xmlhttp.send();
        bbs_song("ask_song",{$list.id});

        // 发送完成后清空内容
        document.getElementById('titleChat').value ="";
        // 发送完成后禁止再次点击发送按钮
        // document.getElementById("sendChat").disabled= true;
        // document.getElementById('chat').scrollTop = document.getElementById('chat').scrollHeight;

        // $('#chat').scrollTop( $('#chat')[0].scrollHeight );
        // var content = document.getElementById('chat');
        // content.scrollTop = content.scrollHeight;

    }
</script>
<script>
    //关于控制视频播放速度
    myVid=document.getElementById("myVideo");
    function getPlaySpeed()
    {
        // alert(myVid.playbackRate);
        document.getElementById("t").innerHTML='当前的播放速度是：'+myVid.playbackRate+'倍';
    }
    function setPlaySpeed(s)
    {
        myVid.playbackRate=s;
    }
</script>
<script type="text/javascript">

    function showtime(t){
        document.getElementById("add").disabled=true;
        // document.getElementById("add").value =" 保存中 ";
        document.getElementById('title').value ="";
        document.getElementById('titlemodel').value ="";
        for(i=1;i<=t;i++) {
            window.setTimeout("update_p(" + i + ","+t+")", i * 1000);
        }

    }

    function update_p(num,t) {
        if(num == t) {
            document.getElementById("add").value ="提交";
            document.getElementById("add").disabled=false;
        }
        else {
            printnr = t-num;
            // document.getElementById("add").value = "已保存";

        }
    }
</script>
{include file="index/footer" /}